#include<bits/stdc++.h>
using namespace std;

struct student{
	int Sno;
	double grade;
}a[105];

bool cmp(student x,student y)
{
	return x.grade>y.grade; 
}

int main()
{
	int n,k;
	cin>>n>>k;
	
	for (int i=1;i<=n;i++)
	{
		cin>>a[i].Sno;
		cin>>a[i].grade;
	}
	
	stable_sort(a+1,a+1+n,cmp);//按grade排序
	
	printf("%d %g",a[k].Sno,a[k].grade);
}